name: Gherkin Lint

on:
  pull_request:
    # If updating `paths` then update gherkin-lint-none.yml to match
    paths:
      - '.github/workflows/gherkin-lint.yml'
      - '.gherkin-lintignore'
      - '.gherkin-lintrc'
      - 'package*.json'
      - '**.feature'

env:
  NODE_VERSION: 18.x

jobs:
  gherkin_lint:
    name: Run gherkin-lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: ${{ env.NODE_VERSION }}
          cache: 'yarn'
      - run: bin/yarn install --frozen-lockfile --immutable
      - run: bin/yarn gherkin-lint
